/**
 * @description: 转义成toBase64
 * @param {string} str
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function string2Base64(str: string) {
    let buffer = Buffer.from(str, "utf-8");
    return buffer.toString("base64");
}


/**
 * @description: base64解码
 * @param {string} base64
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function base642String( base64:string ){
    return Buffer.from(base64,'base64').toString('utf-8')
}